package com.atguigu.gulimall.search.feign;

import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("gulimall-gateway")
public interface ProductFeignService {

    /**
     * 通过网关获取attr信息
     */
    @RequestMapping("/api/product/attr/info/{attrId}")
    // @RequiresPermissions("product:attr:info")
    R attrInfo(@PathVariable("attrId") Long attrId);

    /**
     * 根据品牌id列表查询品牌信息
     */
    @RequestMapping("/api/product/brand/infos")
    R brandInfo(@RequestParam("brandIds") List<Long> brandIds);

    /**
     * 分类信息
     */
    @RequestMapping("/api/product/category/info/{catId}")
    R catalogInfo(@PathVariable("catId") Long catId);
}
